package com.cxq.boot.exception;

//自定义异常类
//继承 RuntimeException 避免需要在有地方处需要使用 try-catch
public class CustomizeException extends RuntimeException{
    private Integer code;
    private String message;

    public CustomizeException(ICustomizeErrorCode errorCode){
        this.code = errorCode.getCode();
        this.message = errorCode.getMessage();
    }

    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
